package com.hyx.spring.bean;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * @Author hyx
 * @Description 测试InitializingBean接口和DisposableBean接口
 * @Date 2024/3/10 21:10
 * @Version 1.0
 */
public class Animal implements InitializingBean, DisposableBean {

    public Animal(){
        System.out.println("执行了Animal类中无参数的构造方法");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("执行了Animal类的销毁方法。。。。");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行了Animal类的初始化方法。。。。。。。");
    }
}
